# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Adrià Arrufat (archdria) <adria dot arrufat at protonmail ldot ch>

pkgname=libhttpseverywhere
pkgver=0.4.8
pkgrel=1
pkgdesc="Leverage the power of HTTPS Everywhere"
url="https://git.gnome.org/browse/libhttpseverywhere"
arch=(i686 x86_64)
license=(LGPL3)
depends=(libgee libxml2 libarchive libsoup glib2 json-glib)
makedepends=(meson valadoc gobject-introspection git)
_commit=ae932260bb02190d43b91453fca2683962d42872  # tags/0.4.8^0
source=("git+https://git.gnome.org/browse/libhttpseverywhere#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  mkdir build
  cd $pkgname
}

build() {
  cd build
  meson --prefix=/usr --buildtype=release ../$pkgname \
    -Denable_valadoc=true
  ninja
}

check() {
  cd build
  mesontest
}

package() {
  cd build
  DESTDIR="$pkgdir" ninja install
}
